#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPixmap pixmap(":/2.png");
    pixmap = pixmap.scaled(30,30);
    QCursor cursor(pixmap);
    ui->pushButton->setCursor(cursor);
    ui->pushButton_2->setCursor(cursor);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    double opacity = this->windowOpacity();
    if(opacity >= 1.0) return;
    opacity += 0.1;
    this->setWindowOpacity(opacity);
}

void Widget::on_pushButton_2_clicked()
{
    double opacity = this->windowOpacity();
    if(opacity <= 0.0) return;
    opacity -= 0.1;
    this->setWindowOpacity(opacity);
}

